<h:panelGrid xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<h1>Matriz de priorização das partes interessadas</h1>

	<a4j:outputPanel id="table">
		<table border="1" class="dr-table rich-table">
			<thead class="dr-table-thead">
				<tr class="dr-table-header rich-table-header">
					<th class="dr-table-headercell rich-table-headercell"></th>
					<a4j:repeat value="#{projeto.matriz}" var="nomes">
						<th class="dr-table-headercell rich-table-headercell"><h:outputText
								value="#{nomes.get(0).stakeholderavaliado.usuario.nome}" />
						</th>
					</a4j:repeat>
					<th class="dr-table-headercell rich-table-headercell">Total da
						linha</th>
					<th class="dr-table-headercell rich-table-headercell">Ranking
						de <br />classificação</th>
				</tr>
			</thead>
			<tbody>
				<a4j:repeat value="#{projeto.matriz}" var="linha" rowKeyVar="row">
					<tr>
						<td align="center" class="dr-subtable-cell rich-subtable-cell"><h:outputText
								value="#{linha.get(0).stakeholderavaliado.usuario.nome}" />
						</td>
						<a4j:repeat value="#{linha}" var="coluna" rowKeyVar="col">
							<s:fragment rendered="#{row == col}">
								<td align="center" class="dr-subtable-cell rich-subtable-cell"></td>
								<td align="center" class="dr-subtable-cell rich-subtable-cell"><h:outputText
										value="#{coluna.nota.valor}" />
								</td>
							</s:fragment>
							<s:fragment rendered="#{row != col}">
								<td align="center" class="dr-subtable-cell rich-subtable-cell"><h:outputText
										value="#{coluna.nota.valor}" />
								</td>
							</s:fragment>
							<s:fragment
								rendered="#{col == (linha.size()-1) &amp;&amp; row == (projeto.matriz.size()-1)}">
								<td align="center" class="dr-subtable-cell rich-subtable-cell"></td>
							</s:fragment>
						</a4j:repeat>
						<td align="center" class="dr-subtable-cell rich-subtable-cell">
							<h:outputFormat
								value="#{projeto.calculaTotal(linha.get(0).stakeholderavaliado.id)}">
								<f:convertNumber maxFractionDigits="2" />
							</h:outputFormat></td>
						<td align="center" class="dr-subtable-cell rich-subtable-cell">
							<h:outputText
								value="#{projeto.calculaClassificacao(linha.get(0).stakeholderavaliado.id)}°" />
						</td>
					</tr>
				</a4j:repeat>
			</tbody>
		</table>
		<br />
		<h:panelGrid>
			<f:facet name="header">Legenda da classificação</f:facet>
			<rich:dataList value="#{projeto.legenda}" var="leg">
				<h:outputText value="#{leg.valor}=#{leg.nome}" />
			</rich:dataList>
		</h:panelGrid>
	</a4j:outputPanel>
</h:panelGrid>